<?php

namespace app\admin\validate;

use think\Validate;

class Menu extends Validate
{

    protected $rule = [
        'name'=>'require|max:100|chsDash',
        'sort' => 'require|number',
    ];
    protected $message  =   [
        'name.require'     =>'ERR_MISSING_NAME',
        'name.max'     =>'ERR_NAME_FORMAT_INCORRECT',
        'sort.require'     =>'ERR_MISSING_SORT',
        'sort.number'      =>'ERR_SORT_FORMAT_INCORRECT',
    ];

    protected $scene = [
        'add' => [
            'name',
            'sort',
        ],
        'update' => [
            'name',
            'sort',
        ]
    ];
}